package org.luxor.accesslog.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.luxor.commons.core.utils.DateUtils;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * 访问审计日志查询参数
 *
 * @author Mr.yan @date 2020/4/6
 */
@ApiModel("访问日志查询参数")
public class AccessLogQuery {

    @ApiModelProperty(value = "用户名称", example = "颜新明")
    private String userName;

    @NotBlank(message = "方法名不能为空")
    @ApiModelProperty(value = "开始时间(格式：yyyy/MM/dd HH:mm:ss)", example = "2020/04/06 20:00:00")
    @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN, timezone = "GMT+8")
    private Date beginTime;

    @NotBlank(message = "方法名不能为空")
    @ApiModelProperty(value = "结束时间(格式：yyyy/MM/dd HH:mm:ss)", example = "2020/04/06 25:00:00")
    @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN, timezone = "GMT+8")
    private Date endTime;

    @ApiModelProperty(value = "详情描述", example = "删除文件对象内容")
    private String message;

    public AccessLogQuery() {
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "AccessLogQuery{" +
                "userName='" + userName + '\'' +
                ", beginTime='" + beginTime + '\'' +
                ", endTime='" + endTime + '\'' +
                ", message='" + message + '\'' +
                '}';
    }
}
